<html ng-app="ionicApp">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    
    <title>Sign-in, Then Tabs Example</title>
	
   <script type="text/javascript" src="js/jquery.min.js"></script>
   <script type="text/javascript" src="pop.js"></script>	
<link type="text/css" rel="stylesheet" href="popup.css" />
    <link href="css/ionic.min.css" rel="stylesheet">
    <script src="js/ionic.bundle.min.js"></script>
    <script type="text/javascript" src="app.js"></script>
    <script type="text/javascript" src="js/commentService.js"></script>
    <link href="css/style.css" rel="stylesheet">




    <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
   Remove this if you use the .htaccess -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="initial-scale=1.0, target-densitydpi=device-dpi" /><!-- this is for mobile (Android) Chrome -->
  <meta name="viewport" content="initial-scale=1.0, width=device-height"><!--  mobile Safari, FireFox, Opera Mobile  -->
  <script src="jssignature/libs/modernizr.js"></script>
      <!--[if lt IE 9]>
    <script type="text/javascript" src="jssignature/libs/flashcanvas.js"></script>
  <![endif]-->
  <script src="jssignature/libs/jSignature.min.js"></script>
  
 
  

  </head>

  <body ng-controller ="listcontactCtrl" id="body">
    
    <ion-nav-bar animation="nav-title-slide-ios7" 
                 type="bar-positive" ></ion-nav-bar>
             
    <ion-nav-view animation="slide-left-right"></ion-nav-view>

    <script id="sign-in.html" type="text/ng-template">
      <ion-view title="'Sign-In'" left-buttons="leftButtons" right-buttons="rightButtons">
        <ion-content has-header="true">
          <div class="list">

            <label class="item item-input">
              <span class="input-label">Username</span>
              <input type="text" ng-model="user.username">
            </label>
            <label class="item item-input">
              <span class="input-label">Password</span>
              <input type="password" ng-model="user.password">
            </label>
          </div>
          <div class="padding">	

            <button class="button button-block button-positive" ng-click="signIn()">
              Sign-In
            </button>
          </div>
		  
		  	
        </ion-content>
      </ion-view>
    </script>

    <script id="forgot-password.html" type="text/ng-template">
      <ion-view title="'Forgot Password'">
        <ion-content has-header="true" padding="true">
          <p>
            Yeah this is just a demo showing how views can be shown without tabs, then you can navigate
            to views within tabs. Additionally, only one set of tabs needs to be written for all of the different views that should go inside the tabs. (Compared to written the same tab links in the footer of every view that's in a tab.)
          </p>
          <p>
            There's no username/password, just click
            the Sign-In button back a the sign-in view.
          </p>
          <p>
            Return to <a href="#/sign-in">Sign-In</a>.
          </p>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="tabs.html" type="text/ng-template">
      <ion-tabs tabs-style="tabs-icon-top" tabs-type="tabs-positive">

        <ion-tab title="Home" icon="ion-home" href="#/tab/home">
          <ion-nav-view name="home-tab"></ion-nav-view>
        </ion-tab>

        <ion-tab title="Sign-Out" icon="ion-log-out" onclick="alert('fwe')"  href="#/sign-in">
        </ion-tab>

      </ion-tabs>
    </script>

    <script id="home.html" type="text/ng-template">
      <ion-view title="'List of patients'" data-ng-init="initHome()">
        <ion-content has-header="true">

          <div class="list" ng-repeat="contact in contacts">
              <a class="item item-avatar" ng-click="showContact(contact.id, contact.fullname,contact.dob,contact.avartar)" href="#/tab/facts">
                <img ng-if="contact.avartar != null" src="{{contact.avartar}}">
                <img ng-if="contact.avartar == null" src="img/noavatar1.png">
               
                <h2>{{contact.fullname}}</h2>
                <p>{{contact.primary_phone}}</p>
              </a>
          </div>
        </ion-content>
      </ion-view>
    </script>

    <script id="facts.html" type="text/ng-template">
      <ion-view title="'Patient Record'" left-buttons="leftButton" data-ng-init="initRules()">
      <div class="bar bar-subheader" >
       <div style="float:left;padding-left:10px; margin-top:-5px;">
           <div >Name: {{contactrecord.fullname}}</div>
          <div >Birthday: {{contactrecord.dob | date:'dd-MM-yyyy'}}</div></div>
		<div style="float:right;padding-right:5px;font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;">
		<i ng-if="episodeDetail.eye=='RE'">{{episodeDetail.eye}}</i>
		<i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i>
		<img ng-if="contactrecord.avartar != null" class="dropshadowclass" src="{{contactrecord.avartar}}" style="width:35px;height:35px" ng-click="showPopupImage()"/>
    <img ng-if="contactrecord.avartar == null" class="dropshadowclass" src="img/noavatar1.png" style="width:35px;height:35px" ng-click="showPopupImage()"/>
		<i ng-if="episodeDetail.eye=='LE'">{{episodeDetail.eye}}</i>
		<i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i></div>
		
      </div>
        <ion-content has-header="true" padding="true" has-subheader='true' has-footer="true">
		
          <div class="list">
            <a class="item item-thumbnail-left" ng-click="detailContact(contactrecord.id)" href="#/tab/facts2">
              <img src="img/Chat-icon.png">
              <h2>Contact profile</h2>
               <p>{{contactrecord.fullname}}</p>			   
            </a>
            <a ng-if="display1=='normal'" class="item item-thumbnail-left"   ng-click="checkRecord(contactrecord.id)" href="#/tab/facts3">
              <img src="img/nurse-icon.png">
              <h2>Nursing Record</h2>              
            </a>
      
            <a ng-if="display1=='active'" class="link-active item item-thumbnail-left"   ng-click="checkRecord(contactrecord.id)" href="#/tab/facts3">
              <img src="img/nurse-icon.png">
              <h2 class="tf">Nursing Record</h2>              
            </a>
            <div ng-if="display1=='disable'" class="link-disable item item-thumbnail-left" >
              <img src="img/nurse-icon.png">
              <h2 class="text-disable">Nursing Record</h2>              
            </div>
      
      
            <a ng-if="display2=='normal'" class="item item-thumbnail-left"   ng-click="checkDrugchart(contactrecord.id)" href="#/tab/facts4">
              <img src="img/Natural-drugs-icon.png">
              <h2>Drug Chart for Systemic Diseases</h2>              
            </a>
      
            <a ng-if="display2=='active'" class="link-active item item-thumbnail-left"   ng-click="checkDrugchart(contactrecord.id)" href="#/tab/facts4">
              <img src="img/Natural-drugs-icon.png">
              <h2 class="text-active">Drug Chart for Systemic Diseases</h2>              
            </a>
            <div ng-if="display2=='disable'" class="link-disable item item-thumbnail-left" >
              <img src="img/Natural-drugs-icon.png">
              <h2 class="text-disable">Drug Chart for Systemic Diseases</h2>              
            </div>
      
            <a ng-if="display3=='normal'" class="item item-thumbnail-left"   ng-click="checkOpe(contactrecord.id)" href="#/tab/facts5">
              <img src="img/Inventory-icon.png">
              <h2>Pre - Operative Record</h2>              
            </a>
      
            <a ng-if="display3=='active'" class="link-active item item-thumbnail-left"   ng-click="checkOpe(contactrecord.id)" href="#/tab/facts5">
              <img src="img/Inventory-icon.png">
              <h2 class="text-active">Pre - Operative Record</h2>              
            </a>
            <div ng-if="display3=='disable'" class="link-disable item item-thumbnail-left" >
              <img src="img/Inventory-icon.png">
              <h2 class="text-disable">Pre - Operative Record</h2>              
            </div>
        </div>
		<div style="display: none;" id="blanket" ng-click="hidePopupSign();hidePopupImage()"></div>
        </ion-content>
      </ion-view>
    </script> 

    <script id="facts2.html" type="text/ng-template">
      <ion-view title="'Contact information'" left-buttons="leftButton" data-ng-init="initDetailcontact()">
        <ion-content has-header="true" padding="true" has-footer="true">
        <div class="imgavartar imgavartar-thumbnail-left">
          <img ng-if="contactrecord.avartar != null" class="avartar" src="{{contactrecord.avartar}}">
          <img ng-if="contactrecord.avartar == null" class="avartar" src="img/noavatar1.png">
    <h2 class="namecontact">{{contactrecord.fullname}}</h2>
    <p class="namecontact"><b>Phone:</b> {{contactrecord.primary_phone}}</p>
     <p class="namecontact"><b>Email: </b>{{contactrecord.email}}</p>
     <p class="namecontact"><b>Address:</b>{{contactrecord.address1}},{{contactrecord.ward}}, {{contactrecord.city}}</p>
    </div> 
        </ion-content>
      </ion-view>
    </script>

    <script id="facts3.html" type="text/ng-template">
      <ion-view title="'Nursing Record'"  left-buttons="leftButton" right-buttons="rightNurseButton" data-ng-init="initNursingRecord()">
      <div class="bar bar-subheader">
        <div style="float:left;padding-left:10px; margin-top:-5px;">
           <div >Name: {{contactrecord.fullname}}</div>
          <div >Birthday: {{contactrecord.dob | date:'dd-MM-yyyy'}}</div></div>
        <div style="float:right;padding-right:5px;font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;">
        <i ng-if="episodeDetail.eye=='RE'">{{episodeDetail.eye}}</i>
        <i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i>
        <img class="dropshadowclass" src="{{contactrecord.avartar}}" style="width:35px;height:35px" ng-click="showPopupImage()"/>
        <i ng-if="episodeDetail.eye=='LE'">{{episodeDetail.eye}}</i>
        <i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i></div>
      </div>
        <ion-content has-header="true" has-footer="true" has-subheader='true'>
        <div class="row">
        <p style="margin-left:20px;margin-right:30px;margin-top:7px;">Name:</p>  
        <div class="col col-35"><input type="text" ng-model="contactrecord.fullname" placeholder="________________________________"></div>
        <p style="margin-left:20px;margin-right:20px;margin-top:7px;">Age:</p>
         <div class="col col-35"><input type="text" placeholder="________________________________"></div>
        <p style="margin-left:20px;margin-right:20px;margin-top:7px;">Gender:</p>
        <div class="col col-10"><input type="text" placeholder="__________"></div>
      </div>
      <div class="row">
        <p style="margin-left:20px;margin-right:20px;margin-top:7px;">M.R.No:</p>  
        <div class="col col-35"><input type="text" placeholder="________________________________"></div>
        <p style="margin-left:20px;margin-right:20px;margin-top:7px;">Date:</p>
         <div class="col col-35"><input type="text" ng-click="addDate()" ng-model="nurserecord.date" placeholder="________________________________"></div>
         <div class="col col-10"></div>
      </div>
        <div class="list card">
          <div class="item item">
            <div class="row">
            <div class="col col-75">Receiving the patient iin ward</div>
            <div class="col"> <input type="text" ng-if="nurserecord.disabled=='disabled'" disabled="disabled"  placeholder="Time"  ng-model="nurserecord.rectime">
              <input type="text" ng-if="nurserecord.disabled==null" ng-click="addTime(1)"  placeholder="Time"  ng-model="nurserecord.rectime"></div>
            </div>
          </div>
          <div class="item item">
            <div class="row">
            <div class="col col-75">Verified patient details and wrist band</div>
            <div class="col"><input type="text" ng-if="nurserecord.disabled=='disabled'" disabled="disabled"  placeholder="Time"  ng-model="nurserecord.vertime">
              <input type="text" ng-if="nurserecord.disabled==null" ng-click="addTime(2)"  placeholder="Time"  ng-model="nurserecord.vertime">
            </div>
            </div>
          </div>
          <div class="item item">
            <div class="row">
            <div class="col col-75">Eye cleaned with Iodine</div>
            <div class="col"><input type="text" ng-if="nurserecord.disabled=='disabled'" disabled="disabled"  placeholder="Time"  ng-model="nurserecord.eyetime">
              <input type="text" ng-if="nurserecord.disabled==null" ng-click="addTime(3)"  placeholder="Time"  ng-model="nurserecord.eyetime"></div>
            </div>
          </div>
          <div class="item item">
            <div class="row">
            <div class="col col-75">Verified consent form</div>
            <div class="col"><input type="text" ng-if="nurserecord.disabled=='disabled'" disabled="disabled"  placeholder="Time"  ng-model="nurserecord.vertime1">
              <input type="text" ng-if="nurserecord.disabled==null" ng-click="addTime(4)"  placeholder="Time"  ng-model="nurserecord.vertime1"></div>
            </div>
          </div>
          <div class="item item">
            <div class="row">
            <div class="col col-75">Preoperative instruction given</div>
            <div class="col"><input type="text" ng-if="nurserecord.disabled=='disabled'" disabled="disabled"  placeholder="Time"  ng-model="nurserecord.pretime">
              <input type="text" ng-if="nurserecord.disabled==null" ng-click="addTime(5)"  placeholder="Time"  ng-model="nurserecord.pretime"></div>
            </div>
          </div>
         <div class="item item">
            <div class="row">
            <div class="col col-60"><b>Preoperative votal signs:</b></div>
            <div class="col col-20">
              <label class="item item-input">
                <span class="input-label">B.P:</span>
                
                <input type="text" ng-if="nurserecord.disabled=='disabled'" disabled="disabled"  placeholder="mm/Hg"  ng-model="nurserecord.bp">
              <input type="text" ng-if="nurserecord.disabled==null" placeholder="mm/Hg"  ng-model="nurserecord.bp">
              </label>
            </div>
            <div class="col col-20">
              <label class="item item-input">
                <span class="input-label">Pulse:</span>
                <input type="text" ng-if="nurserecord.disabled=='disabled'" disabled="disabled"  placeholder="/mint"  ng-model="nurserecord.pul">
              <input type="text" ng-if="nurserecord.disabled==null" placeholder="/mint"  ng-model="nurserecord.pul">
              </label>
            </div>
            </div>
             </div>
          <div class="item item">
            <div class="row">
            <div class="col col-67">IOP, Duct results attached</div>
            <div class="col">
				<div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="iop" value="3" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.iop">
              <input type="radio" name="iop" value="3" ng-if="nurserecord.disabled==null" ng-model="nurserecord.iop">
                 </label>
                 NA
              </div>
			  
              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="iop" value="1" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.iop">
              <input type="radio" name="iop" value="1" ng-if="nurserecord.disabled==null" ng-model="nurserecord.iop">
                 </label>
                 Yes
              </div>

              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="iop" value="2" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.iop">
              <input type="radio" name="iop" value="2" ng-if="nurserecord.disabled==null" ng-model="nurserecord.iop">
                 </label>
                 No
              </div>
              
            </div>
            </div>
          </div>
          <div class="item item">
            <div class="row">
            <div class="col col-67">A-sacn report attached</div>
            <div class="col">
			
				<div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="asc" value="3" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.asc">
              <input type="radio" name="asc" value="3" ng-if="nurserecord.disabled==null" ng-model="nurserecord.asc">
                 </label>
                 NA
              </div>
			  
              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="asc" value="1" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.asc">
              <input type="radio" name="asc" value="1" ng-if="nurserecord.disabled==null" ng-model="nurserecord.asc">
                 </label>
                 Yes
              </div>

              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="asc" value="2" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.asc">
              <input type="radio" name="asc" value="2" ng-if="nurserecord.disabled==null" ng-model="nurserecord.asc">
                 </label>
                 No
              </div>
            </div>
            </div>
          </div>


          <div class="item item">
            <div class="row">
            <div class="col col-67">Culture sensitivity needs to take</div>
            <div class="col">

              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="cul" value="2" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.cul">
              <input type="radio" name="cul" value="2" ng-if="nurserecord.disabled==null" ng-model="nurserecord.cul">
                 </label>
                 NA
              </div>
              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="cul" value="1" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.cul">
              <input type="radio" name="cul" value="1" ng-if="nurserecord.disabled==null" ng-model="nurserecord.cul">
                 </label>
                 Yes
              </div>

              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="cul" value="3" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.cul">
              <input type="radio" name="cul" value="3" ng-if="nurserecord.disabled==null" ng-model="nurserecord.cul">
                 </label>
                 No
              </div>
            </div>
            </div>
          </div>
		  
		  <div class="item item">
            <div class="row">
            <div class="col col-67">
				Check stickers
				<p>(Lens, Eye to be operated, systemic, monitoring, SMO)</p>
			</div>
            <div class="col">

			<div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="che" value="3" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.che">
              <input type="radio" name="che" value="3" ng-if="nurserecord.disabled==null" ng-model="nurserecord.che">
                 </label>
                 NA
              </div>
			  
              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="che" value="1" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.che">
              <input type="radio" name="che" value="1" ng-if="nurserecord.disabled==null" ng-model="nurserecord.che">
                 </label>
                 Yes
              </div>

              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="che" value="2" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.che">
              <input type="radio" name="che" value="2" ng-if="nurserecord.disabled==null" ng-model="nurserecord.che">
                 </label>
                 No
              </div>
            </div>
            </div>
          </div>
		  
		  <div class="item item">
            <div class="row">
            <div class="col col-50">
				Physician fitness
			</div>
            <div class="col">
				<div class="item item-checkbox" style="width:150px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="phy" value="1" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.phy">
              <input type="radio" name="phy" value="1" ng-if="nurserecord.disabled==null" ng-model="nurserecord.phy">
                 </label>
                 Done
              </div>
              <div class="item item-checkbox" style="width:165px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="phy" value="2" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.phy">
              <input type="radio" name="phy" value="2" ng-if="nurserecord.disabled==null" ng-model="nurserecord.phy">
                 </label>
                 Not done
              </div>

              <div class="item item-checkbox" style="width:180px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="phy" value="3" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.phy">
              <input type="radio" name="phy" value="3" ng-if="nurserecord.disabled==null" ng-model="nurserecord.phy">
                 </label>
                 Not required
              </div>
            </div>
            </div>
          </div>
		  
		  <div class="item item">
            <div class="row">
            <div class="col col-67">
				Case sheet checking
			</div>
            <div class="col">
			
			<div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="cas" value="3" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.cas">
              <input type="radio" name="cas" value="3" ng-if="nurserecord.disabled==null" ng-model="nurserecord.cas">
                 </label>
                 NA
              </div>
			  
				<div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                   <input type="radio" name="cas" value="1" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.cas">
              <input type="radio" name="cas" value="1" ng-if="nurserecord.disabled==null" ng-model="nurserecord.cas">
                 </label>
                 Yes
              </div>
              <div class="item item-checkbox" style="width:100px;float:left;border:0">
                 <label class="checkbox">
                    <input type="radio" name="cas" value="2" ng-if="nurserecord.disabled=='disabled'" disabled="disabled" ng-model="nurserecord.cas">
              <input type="radio" name="cas" value="2" ng-if="nurserecord.disabled==null" ng-model="nurserecord.cas">
                 </label>
                 No
              </div>
            </div>
            </div>
          </div>          
            </div>
      <TABLE class="table" style="margin-top:10px;">
     <thead>  
        <tr>  
          <th colspan="9">Pre operative medication details</th>  
        </tr>  
      </thead>
      <TR>
      <TD align='center'>Drug name</TD>
      <TD align='center'>Date</TD>
      <TD align='center'>Time</TD>
      <TD align='center'>Verified / Applied by</TD>
      </TR>

      <TR>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD><input type="text"> </TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD><input type="text"> </TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD><input type="text"> </TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD><input type="text"> </TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD><input type="text"> </TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      
  
    </TABLE>
     <TABLE class="table" style="margin-top:10px;">
     <thead>  
        <tr>  
          <th>Blood Sugar Result</th>  
          <th>Date</th>
          <th>Time</th>
          <th>MLOP signature</th>
        </tr>  
      </thead>
      <TR>
      <TD>RBS / FBS / PPBS:</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>

      <TR>
      <TD>RBS / FBS / PPBS:</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>RBS / FBS / PPBS:</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>      
  
    </TABLE>
    <TABLE class="table" style="margin-top:10px;">
     <thead>  
        <tr>  
          <th>Surgery preparation (MLOP verbally confirms with patient)</th>  
          <th>Time</th>
          <th>Verified by</th>
        </tr>  
      </thead>
      <TR>
      <TD>Veri lens sticker with the IP record </TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>

      <TR>
      <TD>Checking the dilatation</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>Diet taken</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>      
      <TR>
      <TD>Pre op systmic medications taken</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>  
      <TR>
      <TD>Culture report collected</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>  
    </TABLE>
    <div class="row">
        <div class="col col-50">
              <TABLE class="table" style="margin-top:10px; margin-right:5px;">
               <thead>  
                  <tr>  
                    <th>Post operative Medication</th>  
                    <th>Time</th>
                    <th>Verified /Applied by</th>
                  </tr>  
                </thead>
                <TR>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                </TR>

                <TR>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                </TR>
                <TR>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                </TR>      
                <TR>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                </TR>  
                <TR>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                <TD><input type="text"></TD>
                </TR>  
              </TABLE>
        </div>
        <div class="col">
            <TABLE class="table" style="margin-top:10px; margin-left:5px;">
             <thead>  
                <tr>  
                  <th>Post operative Medication</th>  
                  <th>Time</th>
                  <th>Verified /Applied by</th>
                </tr>  
              </thead>
              <TR>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              </TR>

              <TR>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              </TR>
              <TR>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              </TR>      
              <TR>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              </TR>  
              <TR>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              <TD><input type="text"></TD>
              </TR>  
            </TABLE>
        </div>
    </div>
            <input type="hidden" ng-model="contactrecord.id">
            
<div style="display: none;" id="blanket" ng-click="hidePopupSign();hidePopupImage()"></div>
        </ion-content>
    </ion-view>
    </script>
	
	
	
	
     <script id="facts4.html" type="text/ng-template">
      <ion-view title="'Drug Chart for Systemic Diseases'" left-buttons="leftButton" right-buttons="rightDrugButton" data-ng-init="initDrugchart()">
      <div class="bar bar-subheader">
          <div style="float:left;padding-left:10px; margin-top:-5px;">
           <div >Name: {{contactrecord.fullname}}</div>
          <div >Birthday: {{contactrecord.dob | date:'dd-MM-yyyy'}}</div></div>
          <div style="float:right;padding-right:5px;font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;">
          <i ng-if="episodeDetail.eye=='RE'">{{episodeDetail.eye}}</i>
          <i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i>
          <img class="dropshadowclass" src="{{contactrecord.avartar}}" style="width:35px;height:35px" ng-click="showPopupImage()"/>
          <i ng-if="episodeDetail.eye=='LE'">{{episodeDetail.eye}}</i>
          <i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i></div>
      </div>
        <ion-content has-header="true" padding="true" has-footer="true" has-subheader="true">
          <div class="row">
			  <div class="col">Kindly tick in the appropriate box and  write duration:</div>
			</div>

			<div class="row">
			  <div class="col col-25">
				<div class="item item-checkbox" style="width:140px;float:left;border:0">
                 <label class="checkbox">
                   <input type="checkbox" name="dia" ng-checked='drugchart.dia' ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.dia" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="dia" ng-checked='drugchart.dia' ng-if="drugchart.disabled==null" ng-model="drugchart.dia" ng-true-value="1" ng-false-value="0">
                 </label>
                 Diabetic
              </div>
              
			  </div>
			  <div class="col"><div class="item item-checkbox" style="width:170px;float:left;border:0">
                 <label class="checkbox">
                   <input type="checkbox" name="hyp" ng-checked='drugchart.hyp' ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.hyp" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="hyp" ng-checked='drugchart.hyp' ng-if="drugchart.disabled==null" ng-model="drugchart.hyp" ng-true-value="1" ng-false-value="0">
                 </label>
                 Hypertensive
              </div></div>
			  <div class="col"><div class="item item-checkbox" style="width:130px;float:left;border:0">
                 <label class="checkbox">
                   <input type="checkbox" name="car" ng-checked='drugchart.car' ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.car" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="car" ng-checked='drugchart.car' ng-if="drugchart.disabled==null" ng-model="drugchart.car" ng-true-value="1" ng-false-value="0">
                 </label>
                 Cardiac
              </div></div>
			  <div class="col"><div class="item item-checkbox" style="width:150px;float:left;border:0">
                 <label class="checkbox">
                   <input type="checkbox" name="ast" ng-checked='drugchart.ast' ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.ast" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="ast" ng-checked='drugchart.ast' ng-if="drugchart.disabled==null" ng-model="drugchart.ast" ng-true-value="1" ng-false-value="0">
                 </label>
                 Asthmatic
              </div></div>
			</div>

			<div class="row">
			  <div class="col col-50"><div class="item item-checkbox" style="width:160px;float:left;border:0">
                 <label class="checkbox">
                   <input type="checkbox" name="ren" ng-checked='drugchart.ren' ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.ren" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="ren" ng-checked='drugchart.ren' ng-if="drugchart.disabled==null" ng-model="drugchart.ren" ng-true-value="1" ng-false-value="0">
                 </label>
                 Renal failure
              </div></div>
			  <div class="col"><div class="item item-checkbox" style="width:150px;float:left;border:0">
                 <label class="checkbox">
                   <input type="checkbox" name="oth" ng-checked='drugchart.oth' ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.oth" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="oth" ng-checked='drugchart.oth' ng-if="drugchart.disabled==null" ng-model="drugchart.oth" ng-true-value="1" ng-false-value="0">
                 </label>
                 Others
              </div></div>
			</div>
			
			<div class="row">
			  <div class="col"><label class="item item-input">
					<span class="input-label">Allergic to:</span>
          <input type="text" ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.all">
              <input type="text" ng-if="drugchart.disabled==null" ng-model="drugchart.all">

				  </label>
			  </div>
			  <div class="col col-75">
			  <label class="item item-input">
				<span class="input-label">Drugs to Aviod:</span>
        <input type="text" ng-if="drugchart.disabled=='disabled'" disabled="disabled" ng-model="drugchart.dru">
              <input type="text" ng-if="drugchart.disabled==null" ng-model="drugchart.dru">
			  </label>
			  </div>
			</div>

      <TABLE class="table" style="margin-top:10px;">
     <thead>  
        <tr>  
          <th colspan="3">To be filled by doctor</th>  
          <th colspan="8">To be filled by MLOP<br>(Time & initials to be noted)</th>  
        </tr>  
      </thead>
      <TR>
      <TD align='center'>No.</TD>
      <TD align='center' width="30%">Medication (with dose)</TD>
      <TD align='center'>Freq.</TD>
      <TD align='center' colspan="4">Date:</TD>
      <TD align='center' colspan="4">Date:</TD>
      </TR>

      <TR>
      <TD>1.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>2.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>3.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>4.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>5.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>6.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>7.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>8.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>9.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>10.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TR>
      <TD>11.</TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      <TD><input type="text"></TD>
      </TR>
      <TD colspan="2">Signature of Doctor</TD>
      <TD>Signature of Staff</TD>
      <TD colspan="4"></TD>
      <TD colspan="4"></TD>
      </TR>
    </TABLE>

		<TABLE class="table" >
			<TR>
			<TD align='center'>Date</TD>
			<TD align='center'>Drug with dose</TD>
			<TD align='center'>Freq.</TD>
			<TD COLSPAN="4" align='center'>Time Given</TD>
			<TD align='center'>Dr. Sign</TD>
			<TD align='center'>MLOP Sign</TD>
			</TR>

			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
			<TR>
			<TD><input type="text"> </TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			<TD><input type="text"></TD>
			</TR>
	
		</TABLE>
    <input type="hidden" ng-model="contactrecord.id">
 <div style="display: none;" id="blanket" ng-click="hidePopupSign();hidePopupImage()"></div>
            
        </ion-content>
      </ion-view>
    </script>

     <script id="facts5.html" type="text/ng-template">
	 
      <ion-view title="'Pre - Operative Record'" left-buttons="leftButton" right-buttons="rightOpeButton" data-ng-init="initOpe()" >
      <div class="bar bar-subheader">
        <div style="float:left;padding-left:10px; margin-top:-5px;">
           <div >Name: {{contactrecord.fullname}}</div>
          <div >Birthday: {{contactrecord.dob | date:'dd-MM-yyyy'}}</div></div>
        <div style="float:right;padding-right:5px;font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;">
        <i ng-if="episodeDetail.eye=='RE'">{{episodeDetail.eye}}</i>
        <i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i>
        <img class="dropshadowclass" src="{{contactrecord.avartar}}" style="width:35px;height:35px" ng-click="showPopupImage()"/>
        <i ng-if="episodeDetail.eye=='LE'">{{episodeDetail.eye}}</i>
        <i ng-if="episodeDetail.eye=='BE'">{{episodeDetail.eye}}</i></div>
      </div>
        <ion-content has-header="true" padding="true" has-footer="true" has-subheader="true">
          
		 <div class="row">
			  <div class="col col-50">
			  <div class="list card">
				<div class="item item">
				<TABLE class="table" >
					<TR>
					<TD align = "center">Eye</TD>
					<TD align = "center">UCVA</TD>
					<TD align = "center">BCVA</TD>
					</TR>

					<TR>
					<TD align="center">RE</TD>
					<TD>
            <input type="text" ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.re_ucv">
              <input type="text" ng-if="pre.disabled==null" ng-model="pre.re_ucv">
          </TD>
					<TD>
            <input type="text" ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.re_bcv">
              <input type="text" ng-if="pre.disabled==null" ng-model="pre.re_bcv">
          </TD>
					</TR>
					<TR>
					<TD align="center">LE</TD>
					<TD>
          <input type="text" ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.le_ucv">
              <input type="text" ng-if="pre.disabled==null" ng-model="pre.le_ucv">
          </TD>
					<TD>
            <input type="text" ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.le_bcv">
              <input type="text" ng-if="pre.disabled==null" ng-model="pre.le_bcv">
          </TD>
					</TR>
	
				</TABLE>
				</div>
				<div class="item item">
				<TABLE class="table" >
					<TR>
					<TD colspan="3" align = "center">Cataract Group</TD>
					</TR>

					<TR>
					<TD align="center"><b>I</b> </TD>
					<TD align="center"><b>II</b> </TD>
					<TD align="center"><b>III</b> </TD>
					</TR>
	
				</TABLE>
				</div>
				<div class="item item">
					<h2><b>Eye: RE / LE</b></h2>
					<h3><b>Len Status</b></h3>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">
               <input type="checkbox" name="nsi" ng-checked='pre.nsi' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.nsi" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="nsi" ng-checked='pre.nsi' ng-if="pre.disabled==null" ng-model="pre.nsi" ng-true-value="1" ng-false-value="0">
						 </label>
						 NS I
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">

                 <input type="checkbox" name="bro" ng-checked='pre.bro' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.bro" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="bro" ng-checked='pre.bro' ng-if="pre.disabled==null" ng-model="pre.bro" ng-true-value="1" ng-false-value="0">
						 </label>
						 Brown
					  </div>
					 </div>
					</div>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">
                <input type="checkbox" name="nsii" ng-checked='pre.nsii' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.nsii" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="nsii" ng-checked='pre.nsii' ng-if="pre.disabled==null" ng-model="pre.nsii" ng-true-value="1" ng-false-value="0">
						 </label>
						 NS II
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">

                <input type="checkbox" name="tra" ng-checked='pre.tra' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.tra" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="tra" ng-checked='pre.tra' ng-if="pre.disabled==null" ng-model="pre.tra" ng-true-value="1" ng-false-value="0">
						 </label>
						 Traumatic
					  </div>
					 </div>
					</div>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">
                <input type="checkbox" name="nsiii" ng-checked='pre.nsiii' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.nsiii" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="nsiii" ng-checked='pre.nsiii' ng-if="pre.disabled==null" ng-model="pre.nsiii" ng-true-value="1" ng-false-value="0">
						 </label>
						 NS III
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:170px;float:left;border:0">
						 <label class="checkbox">
               <input type="checkbox" name="pen" ng-checked='pre.pen' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.pen" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="pen" ng-checked='pre.pen' ng-if="pre.disabled==null" ng-model="pre.pen" ng-true-value="1" ng-false-value="0">
						 </label>
						 (Penetrating)
					  </div>
					 </div>
					</div>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">
               <input type="checkbox" name="nsiv" ng-checked='pre.nsiv' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.nsiv" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="nsiv" ng-checked='pre.nsiv' ng-if="pre.disabled==null" ng-model="pre.nsiv" ng-true-value="1" ng-false-value="0">
						 </label>
						 NS IV
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:190px;float:left;border:0">
						 <label class="checkbox">

               <input type="checkbox" name="sub" ng-checked='pre.sub' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.sub" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="sub" ng-checked='pre.sub' ng-if="pre.disabled==null" ng-model="pre.sub" ng-true-value="1" ng-false-value="0">
						 </label>
						 Subluxated Lens
					  </div>
					 </div>
					</div>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">
                <input type="checkbox" name="psc" ng-checked='pre.psc' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.psc" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="psc" ng-checked='pre.psc' ng-if="pre.disabled==null" ng-model="pre.psc" ng-true-value="1" ng-false-value="0">
						 </label>
						 PSCC
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:170px;float:left;border:0">
						 <label class="checkbox">
                <input type="checkbox" name="pha" ng-checked='pre.pha' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.pha" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="pha" ng-checked='pre.pha' ng-if="pre.disabled==null" ng-model="pre.pha" ng-true-value="1" ng-false-value="0">
						 </label>
						 Phacolytic
					  </div>
					 </div>
					</div>
					
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">

               <input type="checkbox" name="ppc" ng-checked='pre.ppc' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.ppc" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="ppc" ng-checked='pre.ppc' ng-if="pre.disabled==null" ng-model="pre.ppc" ng-true-value="1" ng-false-value="0">
						 </label>
						 PPC
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:190px;float:left;border:0">
						 <label class="checkbox">
               <input type="checkbox" name="pha1" ng-checked='pre.pha1' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.pha1" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="pha1" ng-checked='pre.pha1' ng-if="pre.disabled==null" ng-model="pre.pha1" ng-true-value="1" ng-false-value="0">
						 </label>
						 Phacomorphic
					  </div>
					 </div>
					</div>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">

                 <input type="checkbox" name="cor" ng-checked='pre.cor' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.cor" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="cor" ng-checked='pre.cor' ng-if="pre.disabled==null" ng-model="pre.cor" ng-true-value="1" ng-false-value="0">
						 </label>
						 Cortical
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">

                 <input type="checkbox" name="aph" ng-checked='pre.aph' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.aph" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="aph" ng-checked='pre.aph' ng-if="pre.disabled==null" ng-model="pre.aph" ng-true-value="1" ng-false-value="0">
						 </label>
						 Aphakia
					  </div>
					 </div>
					</div>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">
                <input type="checkbox" name="mat" ng-checked='pre.mat' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.mat" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="mat" ng-checked='pre.mat' ng-if="pre.disabled==null" ng-model="pre.mat" ng-true-value="1" ng-false-value="0">
						 </label>
						 Mature 
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:180px;float:left;border:0">
						 <label class="checkbox">
                <input type="checkbox" name="pse" ng-checked='pre.pse' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.pse" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="pse" ng-checked='pre.pse' ng-if="pre.disabled==null" ng-model="pre.pse" ng-true-value="1" ng-false-value="0">
						 </label>
						 Pseudophakia
					  </div>
					 </div>
					</div>
					<div class="row">
					<div class="col col-33">
						<div class="item item-checkbox" style="width:170px;float:left;border:0">
						 <label class="checkbox">

               <input type="checkbox" name="hyp" ng-checked='pre.hyp' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.hyp" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="hyp" ng-checked='pre.hyp' ng-if="pre.disabled==null" ng-model="pre.hyp" ng-true-value="1" ng-false-value="0">
						 </label>
						 Hypermature
					  </div>
					 </div>
					<div class="col">
					  <div class="item item-checkbox" style="width:150px;float:left;border:0">
						 <label class="checkbox">

                <input type="checkbox" name="oth" ng-checked='pre.oth' ng-if="pre.disabled=='disabled'" disabled="disabled" ng-model="pre.oth" ng-true-value="1" ng-false-value="0">
              <input type="checkbox" name="oth" ng-checked='pre.oth' ng-if="pre.disabled==null" ng-model="pre.oth" ng-true-value="1" ng-false-value="0">
						 </label>
						 Others
					  </div>
					 </div>
					</div>
				</div>
              </div>
			  </div>

			  <div class="col">
				
				<div class="list card">
				  <div class="item item">
	 
					
						<h2><b>Co-Existing Eye Disease</b></h2>
						<div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 None
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Glaucoma
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Diabetic Retinopathy
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Macular degeneration
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Ambolyopia
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Previous refractive surgery
						  </div>
						 </div>
						 <div class="row">
						<div class="col">
							<br>
							<h2 style="padding-top:9px"><b>Complication Co-morbidity</b></h2>
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 None
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Small pupil (4mm or less)
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Pseudoexfoliation
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Corneal opacity
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Shallow AC
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 High myopia
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Previous Intraocular surgery
						  </div>
						 </div>
						 <div class="row">
						<div class="col>
							<div class="item item-checkbox" style="width:150px;float:left;border:0">
							 <label class="checkbox">
							   <input type="checkbox" name="group">
							 </label>
							 Others
						  </div>
						 </div>
						</div>
					
				  </div>

				  <div class="item item">
					<p>Diagnosis</p>
					<p>RE</p>
					<p>LE</p>
				  </div>
				</div>

			  </div>
		</div>
    
		   <div style="float: left;width:150px;padding-bottom:30px">Doctors Signature:</div>
		   <div style="float: left;width:150px" ng-click="showPopup()">
		  
		   <div  id="doctorssign"> <img src="{{pre.sign}}" ng-if="pre.sign!=null" style="width:90px;height:30px"><p>_______</p></div>
		   </div>
			
		  
		  <input type="hidden" ng-model="contactrecord.id">
			<div style="display: none;" id="blanket" ng-click="hidePopupSign();hidePopupImage()"></div>
			<div style="display:block;" id="popUpDiv">
			<div id="contentsignature" style="height:150px">
			   <div id="signature" width = "200px" style="height:150px"></div>
			<div id="tools"></div>
			</div>
			</div>

		<script>
		$(document).ready(function(){
		  $("#popUpDiv").hide();
		});
		</script>

        </ion-content>
      </ion-view>
    </script>

     

		
      <div style="display:block;" id="popUpDivImage">
      <button ng-if="episodeDetail.eye=='RE'" class="button button-clear button-positive"  style="position: absolute;float:left;width:20px;background-color:white;margin-top:100px">{{episodeDetail.eye}}</button>
      <button ng-if="episodeDetail.eye=='BE'" class="button button-clear button-positive"  style="position: absolute;float:left;width:20px;background-color:white;margin-top:100px">{{episodeDetail.eye}}</button>
      <img  src="{{contactrecord.avartar}}" style="width:320px;height:320px;float:left" />
      <div ng-if="episodeDetail.eye=='LE'" class="button button-clear button-positive"  style="position: absolute;float:right;width:20px;background-color:white;margin-top:100px;margin-left:-52px">{{episodeDetail.eye}}</div>
      <div ng-if="episodeDetail.eye=='BE'" class="button button-clear button-positive"  style="position: absolute;float:right;width:20px;background-color:white;margin-top:100px;margin-left:-52px">{{episodeDetail.eye}}</div>
      </div>

      <script>
        $(document).ready(function(){
          $("#popUpDivImage").hide();
        });
      </script>
    <!--<div id="signature"></div>
    <div id="tools"></div>
  <div><p>Display Area:</p><div id="displayarea"></div></div>
    <div id="scrollgrabber"></div>-->
    <script id="about.html" type="text/ng-template">
      <ion-view title="'About'">
        <ion-content has-header="true" padding="true">
          <h3>Create hybrid mobile apps with the web technologies you love.</h3>
          <p>Free and open source, Ionic offers a library of mobile-optimized HTML, CSS and JS components for building highly interactive apps.</p>
          <p>Built with Sass and optimized for AngularJS.</p>
          <p>
            <a class="button icon icon-right ion-chevron-right" href="#/tab/navstack">Tabs Nav Stack</a>
          </p>
        </ion-content>
      </ion-view>
    </script>

    <script id="nav-stack.html" type="text/ng-template">
      <ion-view title="'Tab Nav Stack'">
        <ion-content has-header="true" padding="true">
          <p><img src="http://ionicframework.com/img/diagrams/tabs-nav-stack.png" style="width:100%"></p>
        </ion-content>
      </ion-view>
    </script>

    <script id="modal.html" type="text/ng-template">
      <div class="modal">
        <header class="bar bar-header bar-positive">
          <h1 class="title">Im fewfA Modal</h1>
          <div class="button button-clear" ng-click="modal.hide()"><span class="icon ion-close"></span></div>
        </header>
        <content has-header="true" padding="true">
          <p>This is a modal</p>
          fewfwefewfwefefe
          fewfwefewfwefefefew
          few<p>fefef</p>
          <div id="signature"></div>
            <div id="tools"></div>
          <div><p>Display Area:</p><div id="displayarea"></div></div>
            <div id="scrollgrabber">
        </content>
      </div>
    </script>
    <script id="intro.html" type="text/ng-template"> 
      <ion-view left-buttons="leftButtons" right-buttons="rightButtons">
        <ion-slide-box on-slide-changed="slideChanged(index)">
          <ion-slide>
            <h3>Thank you for choosing the Awesome App!</h3>
            <div id="logo">
              <img src="http://code.ionicframework.com/assets/img/app_icon.png">
            </div>
            <p>
              Weve worked super hard to make you happy.
            </p>
            <p>
              But if you are angry, too bad.
            </p>
          </ion-slide>
          <ion-slide>
            <h3>Using Awesome</h3>
            
            <div id="list">
              <h5>Just three steps:</h5>
              <ol>
                <li>Be awesome</li>
                <li>Stay awesome</li>
                <li>There is no step 3</li>
              </ol>
            </div>
          </ion-slide>
          <ion-slide>
            <h3>Any questions?</h3>
            <p>
              Too bad!
            </p>
          </ion-slide>
        </ion-slide-box>
      </ion-view>
    </script>
    

    <script src="jssignature/libs/jquery.js"></script>
<script>
/*  @preserve
jQuery pub/sub plugin by Peter Higgins (dante@dojotoolkit.org)
Loosely based on Dojo publish/subscribe API, limited in scope. Rewritten blindly.
Original is (c) Dojo Foundation 2004-2010. Released under either AFL or new BSD, see:
http://dojofoundation.org/license for more information.
*/
(function($) {
  var topics = {};
  $.publish = function(topic, args) {
      if (topics[topic]) {
          var currentTopic = topics[topic],
          args = args || {};
  
          for (var i = 0, j = currentTopic.length; i < j; i++) {
              currentTopic[i].call($, args);
          }
      }
  };
  $.subscribe = function(topic, callback) {
      if (!topics[topic]) {
          topics[topic] = [];
      }
      topics[topic].push(callback);
      return {
          "topic": topic,
          "callback": callback
      };
  };
  $.unsubscribe = function(handle) {
      var topic = handle.topic;
      if (topics[topic]) {
          var currentTopic = topics[topic];
  
          for (var i = 0, j = currentTopic.length; i < j; i++) {
              if (currentTopic[i] === handle.callback) {
                  currentTopic.splice(i, 1);
              }
          }
      }
  };
})(jQuery);

</script>
<script src="jssignature/src/jSignature.js"></script>
<script src="jssignature/src/plugins/jSignature.CompressorBase30.js"></script>
<script src="jssignature/src/plugins/jSignature.CompressorSVG.js"></script>
<script src="jssignature/src/plugins/jSignature.UndoButton.js"></script> 
<script src="jssignature/src/plugins/signhere/jSignature.SignHere.js"></script> 
<script>
$(document).ready(function() {
  
  // This is the part where jSignature is initialized.
  var $sigdiv = $("#signature").jSignature({'UndoButton':false})
  
  // All the code below is just code driving the demo. 
  , $tools = $('#tools')
  , $extraarea = $('#displayarea')
  , pubsubprefix = 'jSignature.demo.'
  
  
  $('<input type="button" class="button button-clear button-positive" value="Signature">').bind('click', function(e){
      if (e.target.value !== ''){
	  $("#doctorssign").html("");
      var data = $sigdiv.jSignature('getData','svgbase64')
	  var i = new Image()
	  i.id="dsds";
	  i.style.width="90px";
	  i.style.height="30px";
	  i.src="data:" + data[0] + "," + data[1] ;
	  $(i).appendTo($("#doctorssign")) 
	  $("#popUpDiv").hide();
	  $("#blanket").hide();
    }
  }).appendTo($tools)
  

  
  $('<input type="button" class="button button-clear button-positive" value="Reset">').bind('click', function(e){
    $sigdiv.jSignature('reset')
  }).appendTo($tools)
  

  
  $.subscribe(pubsubprefix + 'formatchanged', function(){
    $extraarea.html('')
  })

  $.subscribe(pubsubprefix + 'image/svg+xml', function(data) {

    try{
      var i = new Image()
      i.src = 'data:' + data[0] + ';base64,' + btoa( data[1] )
      $(i).appendTo($extraarea)
    } catch (ex) {

    }
    
    var message = [
      "If you don't see an image immediately above, it means your browser is unable to display in-line (data-url-formatted) SVG."
      , "This is NOT an issue with jSignature, as we can export proper SVG document regardless of browser's ability to display it."
      , "Try this page in a modern browser to see the SVG on the page, or export data as plain SVG, save to disk as text file and view in any SVG-capabale viewer."
           ]
    $( "<div>" + message.join("<br/>") + "</div>" ).appendTo( $extraarea )
  });

  $.subscribe(pubsubprefix + 'image/svg+xml;base64', function(data) {
    var i = new Image()
    i.src = 'data:' + data[0] + ',' + data[1]
    $(i).appendTo($extraarea)
    
    var message = [
      "If you don't see an image immediately above, it means your browser is unable to display in-line (data-url-formatted) SVG."
      , "This is NOT an issue with jSignature, as we can export proper SVG document regardless of browser's ability to display it."
      , "Try this page in a modern browser to see the SVG on the page, or export data as plain SVG, save to disk as text file and view in any SVG-capabale viewer."
           ]
    $( "<div>" + message.join("<br/>") + "</div>" ).appendTo( $extraarea )
  });
  
  $.subscribe(pubsubprefix + 'image/png;base64', function(data) {
    var i = new Image()
    i.src = 'data:' + data[0] + ',' + data[1]
    $('<span><b>As you can see, one of the problems of "image" extraction (besides not working on some old Androids, elsewhere) is that it extracts A LOT OF DATA and includes all the decoration that is not part of the signature.</b></span>').appendTo($extraarea)
    $(i).appendTo($extraarea)
  });
  
  $.subscribe(pubsubprefix + 'image/jsignature;base30', function(data) {
    $('<span><b>This is a vector format not natively render-able by browsers. Format is a compressed "movement coordinates arrays" structure tuned for use server-side. The bonus of this format is its tiny storage footprint and ease of deriving rendering instructions in programmatic, iterative manner.</b></span>').appendTo($extraarea)
  });

  if (Modernizr.touch){
    $('#scrollgrabber').height($('#content').height())    
  }
  
})
</script>

  </body>
</html>